package com.siyougame.business.dal.mysql.inspect;

import java.util.*;

import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.siyougame.business.controller.app.vo.AppInspectPageReqVO;
import com.siyougame.business.dal.dataobject.template.TemplateDO;
import com.siyougame.common.pojo.PageResult;
import com.siyougame.mybatis.mybatis.core.query.LambdaQueryWrapperX;
import com.siyougame.mybatis.mybatis.core.mapper.BaseMapperX;
import com.siyougame.business.dal.dataobject.inspect.InspectDO;
import org.apache.ibatis.annotations.Mapper;
import com.siyougame.business.controller.admin.inspect.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 检查记录 Mapper
 *
 * @author ${table.author}
 */
@Mapper
public interface InspectMapper extends BaseMapperX<InspectDO> {


    IPage<InspectDO> pageList(IPage<InspectDO> page, @Param(Constants.WRAPPER) Wrapper<InspectDO> queryWrapper);
    default PageResult<InspectDO> selectAppPage(AppInspectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InspectDO>()
                .eqIfPresent(InspectDO::getTempId, reqVO.getTempId())
                .eq(InspectDO::getDepartmentId, reqVO.getDepartmentId())
                .eqIfPresent(InspectDO::getUserId, reqVO.getUserId())
                .likeIfPresent(InspectDO::getName, reqVO.getName())
                .eqIfPresent(InspectDO::getVessels, reqVO.getVessels())
                .orderByDesc(InspectDO::getId));
    }



}